 package tools.packet;

 import client.MapleCharacter;
 import client.inventory.Item;
 import client.inventory.MapleAndroid;
 import client.inventory.MapleInventoryType;
 import constants.ServerConstants;
 import handling.opcode.SendPacketOpcode;
 import java.awt.Point;
 import java.util.List;
 import server.movement.LifeMovementFragment;
 import tools.data.output.MaplePacketLittleEndianWriter;













 public class AndroidPacket
 {
   public static byte[] spawnAndroid(MapleCharacter chr, MapleAndroid android) {
/*  29 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  31 */     mplew.writeShort(SendPacketOpcode.ANDROID_SPAWN.getValue());
/*  32 */     mplew.writeInt(chr.getId());
/*  33 */     mplew.write(android.getType());
/*  34 */     mplew.writePos((android.getPos() == null) ? chr.getTruePosition() : android.getPos());
/*  35 */     mplew.write(android.getStance());
/*  36 */     mplew.writeShort(android.getFh());
/*  37 */     mplew.writeShort((android.getSkin() >= 2000) ? (android.getSkin() - 2000) : android.getSkin());
/*  38 */     mplew.writeShort(android.getHair() - 30000);
/*  39 */     mplew.writeShort(android.getFace() - 20000);
/*  40 */     mplew.writeMapleAsciiString(android.getName());
/*  41 */     mplew.writeInt(0);
/*  42 */     mplew.writeLong(PacketHelper.getTime(-2L));
/*  43 */     for (short s = -1200; s > -1207; s = (short)(s - 1)) {
/*  44 */       Item item = chr.getInventory(MapleInventoryType.EQUIPPED).getItem(s);
/*  45 */       mplew.writeInt((item != null) ? item.getItemId() : 0);
     }
/*  47 */     for (int i = 0; i < 7; i++) {
/*  48 */       mplew.writeInt(0);
     }
/*  50 */     return mplew.getPacket();
   }

















   public static byte[] moveAndroid(int chrId, int v169, int tEncodedGatherDuration, Point startPos, Point velPos, List<LifeMovementFragment> moves) {
/*  70 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  72 */     mplew.writeShort(SendPacketOpcode.ANDROID_MOVE.getValue());
/*  73 */     mplew.writeInt(chrId);
/*  74 */     PacketHelper.serializeMovementList(mplew, v169, tEncodedGatherDuration, startPos, velPos, moves);
/*  75 */     return mplew.getPacket();
   }




   public static byte[] showAndroidEmotion(int chrId, int animation) {
/*  82 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  84 */     mplew.writeShort(SendPacketOpcode.ANDROID_EMOTION.getValue());
/*  85 */     mplew.writeInt(chrId);
/*  86 */     mplew.write(0);
/*  87 */     mplew.write(animation);

/*  89 */     return mplew.getPacket();
   }




   public static byte[] updateAndroidLook(int chrId, int size, int itemId) {
/*  96 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/*  98 */     mplew.writeShort(SendPacketOpcode.ANDROID_UPDATE.getValue());
/*  99 */     mplew.writeInt(chrId);
/* 100 */     switch (size) {
       case -1200:
/* 102 */         mplew.write(1);
         break;
       case -1201:
/* 105 */         mplew.write(2);
         break;
       case -1202:
/* 108 */         mplew.write(4);
         break;
       case -1203:
/* 111 */         mplew.write(8);
         break;
       case -1204:
/* 114 */         mplew.write(16);
         break;
       case -1205:
/* 117 */         mplew.write(32);
         break;
       case -1206:
/* 120 */         mplew.write(64);
         break;
     }
/* 123 */     mplew.writeInt(itemId);
/* 124 */     mplew.write(0);
/* 125 */     mplew.writeInt(0);
/* 126 */     return mplew.getPacket();
   }




   public static byte[] deactivateAndroid(int chrId) {
/* 133 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 135 */     mplew.writeShort(SendPacketOpcode.ANDROID_DEACTIVATED.getValue());
/* 136 */     mplew.writeInt(chrId);

/* 138 */     return mplew.getPacket();
   }







   public static byte[] removeAndroidHeart() {
/* 148 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

/* 150 */     mplew.writeShort(SendPacketOpcode.SHOW_STATUS_INFO.getValue());




/* 155 */     mplew.write(ServerConstants.MapleStatusInfo.移除机器人心脏.getType());

/* 157 */     return mplew.getPacket();
   }
 }


/* Location:              C:\PGX\Server.jar!\tools\packet\AndroidPacket.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */